package work;

public enum ServerType
{
    UNKNOWN((byte) -100, "无法识别"),
    // 未付款
    NO_RECIVER_RESEND((byte) 1, "未签收(运损拒收需补发)"), // 未付款
    NO_RECIVER_NO_RESEND((byte) 2, "未签收(其他原因不补发)"), // 未付款
    RECIVER_QUALITY((byte) 3, "已签收(性能故障)"),
    RECIVER_OUT((byte) 4, "已签收(外观故障)"),
    OTHER((byte) 0, "其他"),
    //未签收
    NO_RECIVER_REJECTION((byte) 6,"(未签收)无理由拒收"),
    NO_RECIVER_STOCKOUT((byte) 7,"(未签收)缺货"),
    NO_RECIVER_AGREED_TIME((byte) 8,"(未签收)未按照约定时间发货"),
    NO_RECIVER_NO_DELIVERY((byte) 9,"(未签收)快递/物流一直没送达"),
    NO_RECIVER_RETURN_DELEVERY_FEE((byte) 10,"(未签收)退运费"),
    NO_RECIVER_MISSED_DELIVERY((byte) 11,"(未签收)少件/漏发"),
    NO_RECIVER_PACK((byte) 12,"(未签收)包装/商品破损/污迹已拒签"),
    NO_RECIVER_INVOICE((byte) 13,"(未签收)发票问题"),
    NO_RECIVER_LOSE_DELIVERY((byte) 14,"(未签收)丢件"),
    NO_RECIVER_MISTAKE_BACK((byte) 15,"(未签收)快递误退回"),
    //已签收
    RECIVER_SHIPPING_DAMAGE((byte) 16,"(已签收)运损退货"),
    RECIVER_SEND_WRONG((byte) 17,"(已签收)卖家发错货"),
    RECIVER_NO_MATCH((byte) 18,"(已签收)商品描述尺寸/颜色尺寸等和实物不符"),
    RECIVER_AIR_PARCEL((byte) 19,"(已签收)空包裹"),
    DAYS7_FREE((byte) 5, "7天无理由退货"),
    DAYS7_FREE_FAULT((byte) 20,"(已签收)7天故障退货"),
    RECIVER_RETIRED_MODEL((byte) 21,"(已签收)符合换货条件的已退市型号"),
    RECIVER_CONSENSUS_REFUND((byte) 22, "(已签收)协商一致退款");

    private Byte code;

    private String desc;

    public static ServerType getByCode(byte code)
    {
        ServerType s = UNKNOWN;
        for(ServerType e : ServerType.values())
        {
            if(e.code == code)
            {
                s = e;
                break;
            }
        }
        return s;
    }

    private ServerType(Byte code, String desc)
    {
        this.code = code;
        this.desc = desc;
    }

    public Byte getCode()
    {
        return code;
    }

    public String getDesc()
    {
        return desc;
    }
}
